The Message Services Application Programming Interface (API) provides an interface for communication between clients (e.g., a software application or a component thereof). The API is a Message Oriented Middleware (MOM) API that provides mechanisms for creating, sending, receiving, and reading messages using one of two models: (i) a point-to-point (i.e. queuing) model; and (ii) a publish-subscribe (i.e. topic) model.
In the point-to-point model, a producer client (i.e., a sending client) posts a message to a queue and a consumer client (i.e., a receiving client) consumes (i.e., receives and processes) the message from the queue. In the point-to-point model, the producer client is not aware of the consuming client, or even if there is a consumer client registered for the queue. The producer client sends the JMS message to a particular queue, where the message will be consumed at a later time by only one consumer client. The producer client does not have control over if and when the JMS message will be received and processed by a consumer client. Thus, the point-to-point model is one-to-one because only one consumer client consumes the posted message. Further, the consumer client typically acknowledges the receipt of the message to the producer client.
In the publish-subscribe model, a publisher client publishes a JMS message to a topic by sending the message to the topic and a subscriber client that is subscribed to the topic may receive the message. In addition, in the publish-subscribe model, multiple subscriber clients may subscribe to the same topic. Thus, all subscriber clients subscribed to the topic receive the same message when the message is published to the topic. Each subscriber client then processes the same message locally.